package airport.server.pojo;

/**
 * Created by Romain on 13/02/15.
 * Developped by Fanch
 */


import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;


@Entity
@Table(name = "VOL")
public class Vol implements Serializable {

    @ManyToMany
    @JoinTable(name = "VOL_HOTEL",
            joinColumns = {@JoinColumn(name = "ID_VOL")},
            inverseJoinColumns = {@JoinColumn(name = "ID_HOTEL")})
    Set<Hotel> hotels = new HashSet<Hotel>(0);

    @OneToMany(mappedBy = "vol", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
    private Set<Panneau> panneau = new HashSet<Panneau>(0);

    @Id
    @GeneratedValue
    @Column(name = "ID_VOL")
    private Long iduser;

    @Column(name = "DATE_D")
    private Date date_depart;

    @Column(name = "DATE_A")
    private Date date_arrivee;

    @Column(name = "LIEU_D")
    private String lieu_depart;

    @Column(name = "LIEU_A")
    private String lieu_arrivee;

    @Column(name = "TARIF")
    private Float tarif;


    public Vol() {
    }

    public Vol(Date dd, Date da, String ld, String la, Float t) {
        date_depart = dd;
        date_arrivee = da;
        lieu_depart = ld;
        lieu_arrivee = la;
        tarif = t;
    }

    public Long getIduser() {
        return iduser;
    }

    public void setIduser(Long iduser) {
        this.iduser = iduser;
    }

    public Date getDate_D() {
        return date_depart;
    }

    public void setDate_D(Date dd) {
        this.date_depart = dd;
    }

    public Date getDate_A() {
        return date_arrivee;
    }

    public void setDate_A(Date da) {
        this.date_arrivee = da;
    }

    public String getLieu_D() {
        return lieu_depart;
    }

    public void setLieu_D(String ld) {
        lieu_depart = ld;
    }

    public String getLieu_A() {
        return lieu_arrivee;
    }

    public void setLieu_A(String la) {
        this.lieu_arrivee = la;
    }

    public Float getTarif() {
        return tarif;
    }

    public void setTarif(Float t) {
        this.tarif = t;
    }

    public Set<Hotel> getHotels() {
        return hotels;
    }

    public void setHotels(Set<Hotel> hotels) {
        this.hotels = hotels;
    }

    public Set<Panneau> getPanneau() {
        return panneau;
    }

    public void setPanneau(Set<Panneau> panneau) {
        this.panneau = panneau;
    }
}